<%-- 
    Document   : empeditlinks
    Created on : Apr 11, 2012, 10:19:17 AM
    Author     : Brian
--%>

<%@page import="classes.Reports"%>
<%@page import="java.util.ArrayList"%>
<script type="text/javascript">
       function change(str){
      $("#main-content").load(str);
       }
</script>
<%
    String query="SELECT * FROM brchung.employee E, brchung.person P WHERE E.SSN=P.SSN and P.role='e';";
    Reports.getConnection(query);
            ArrayList<String[]> rs=Reports.getResults(7,6,13,11,10,2,8,9,4);
            for(int i=0;i<rs.size();i++){
                String[] telephone = rs.get(i)[4].split("-");
                String[] addr=rs.get(i)[6].split(" ");
                String resultAddress="";
                for(int j=0;j<addr.length;j++)
                {
                    if(j==addr.length-1)
                        resultAddress+=addr[j];
                    else
                        resultAddress+=addr[j]+"+";
                }
                out.print("<a onclick=\"change('empeditregistration.jsp?id="+rs.get(i)[2]+"&amp;pass="+rs.get(i)[3]+"&amp;lname="+rs.get(i)[1]+"&amp;fname="+rs.get(i)[0]+"&amp;phone1="+telephone[0]+"&amp;phone2="+telephone[1]+"&amp;phone3="+telephone[2]+"&amp;ssn="+rs.get(i)[5]+"&amp;address="+resultAddress+"&amp;zipcode="+rs.get(i)[7]+"&amp;hourly="+rs.get(i)[8] +"')\" >");
                out.print(rs.get(i)[0]+" "+rs.get(i)[1]+" (id:"+rs.get(i)[2]+")");
                out.print("<br/></a>");
            }
%>
